<?php
class test{
    public $a='';
     public function record(){
         echo 123;
     }
     public function set($m){
          $this->a=$m;
     }
}

 class  test1{
     public function  test2(){
          echo 456;
     }
}

 $a=new test();
 $a->set(new test1());
 $a->a->test2();
